package com.whh.dota2helper;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.whh.dota2helper.model.Hero;
import com.whh.dota2helper.service.HeroService;

/**
 * 英雄故事窗口
 * 
 * @author Splendor
 * 
 */
public class HeroBioActivity extends Activity {

	private HeroService heroService = new HeroService(HeroBioActivity.this);

	private TextView tv_namecn;
	private TextView tv_bio;

	private Hero hero;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_hero_bio);
		init();
	}

	private void init() {
		Intent intent = this.getIntent();
		long id = intent.getLongExtra("id", 1);
		hero = heroService.getHero(id);

		tv_namecn = (TextView) this.findViewById(R.id.tv_title);
		tv_bio = (TextView) this.findViewById(R.id.tv_bio);
		
		tv_namecn.setText(hero.getNameCn().split("\\|")[0]);
		tv_bio.setText("        "+hero.getBio());
	}
}
